/*
 * @Author: 石国庆
 * @Desc: input标签的双击编辑指令
 * @Date: 2017.11.17
 * @Example:
 *
 * <Input v-model="defaultMsg" v-dbedit="cb"/>
 *
 * */
export default {
    name: 'dbedit',
    func: {
        inserted: function (el,binding,vnode) {
            el.children[0].disabled=true
            el.ondblclick=function () {
                this.children[0].disabled=false
                this.children[0].focus()
            }
            el.children[0].onblur=function () {
                if(typeof binding.value=='function'){
                    binding.value()
                }
                this.disabled=true
            }
        }
    }
}

